#include <iostream>
using namespace std;

int main()
{
	int n = 0, count = 0;
	cin >> n;
	while(n)
	{
		count += n % 10;
		n /= 10;
	}
	cout << count << endl;
	return 0;
}
